'use strict';

module.exports = appInfo => {
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1526710449633_1651';

  // add your config here
  config.middleware = [];

  config.view = {
    mapping: {
      '.html': 'ejs',
    },
  };
  config.mongoose = {
    url: 'mongodb://127.0.0.1:12345/vote',
    options: {},
  };

  config.static = {
    prefix: '/public2/',
  };
  config.security = {
    csrf: {
      // 判断是否需要 ignore 的方法，请求上下文 context 作为第一个参数
      ignore: () => true,
    },
  };
  config.bodyParser = {
    jsonLimit: '1000mb',
    formLimit: '1000mb',
  };
  return config;
};
